package com.bjsxt.shop.users.pojo;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户地址的POJO
 * 
 * @author wangshSxt
 *
 */
public class AUsersAddress implements Serializable
{
	private int id;
	private int usersId;
	private int regionId;
	private String name;
	private String contact;
	private String phone;
	private String address;
	private String zipCode;
	private byte isDef;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date pubTime;

	/* 辅助字段 */
	private String statusStr;

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public int getUsersId()
	{
		return usersId;
	}

	public void setUsersId(int usersId)
	{
		this.usersId = usersId;
	}

	public int getRegionId()
	{
		return regionId;
	}

	public void setRegionId(int regionId)
	{
		this.regionId = regionId;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getContact()
	{
		return contact;
	}

	public void setContact(String contact)
	{
		this.contact = contact;
	}

	public String getPhone()
	{
		return phone;
	}

	public void setPhone(String phone)
	{
		this.phone = phone;
	}

	public String getAddress()
	{
		return address;
	}

	public void setAddress(String address)
	{
		this.address = address;
	}

	public String getZipCode()
	{
		return zipCode;
	}

	public void setZipCode(String zipCode)
	{
		this.zipCode = zipCode;
	}

	public byte getIsDef()
	{
		return isDef;
	}

	public void setIsDef(byte isDef)
	{
		this.isDef = isDef;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public String getStatusStr()
	{
		/*
		 * 状态:0:禁用;1:启用
		 */
		AUsersAddressEnum[] usersAddressEnums = AUsersAddressEnum.values();
		for (int i = 0; i < usersAddressEnums.length; i++)
		{
			AUsersAddressEnum goodsBrandEnum = usersAddressEnums[i];
			if (goodsBrandEnum.toString().startsWith("STATUS_"))
			{
				/* 如果循环的枚举==数据库存储的状态值,赋值枚举指定的字符串 */
				if (goodsBrandEnum.getStatus() == this.status)
				{
					this.statusStr = goodsBrandEnum.getInfo();
					break;
				}
			}
		}
		return statusStr;
	}
}
